# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=udsim
pkgver=33.b379464
pkgrel=1
pkgdesc='A graphical simulator that can emulate different modules in a vehicle and respond to UDS request.'
groups=('blackarch' 'blackarch-scanner' 'blackarch-fuzzer' 'blackarch-automobile')
arch=('x86_64' 'aarch64')
url='https://github.com/zombieCraig/UDSim/'
license=('GPL3')
depends=('sdl2' 'sdl2_image' 'sdl2_ttf')
makedepends=('git')
source=('git+https://github.com/zombieCraig/UDSim.git')
sha512sums=('SKIP')

pkgver() {
  cd UDSim

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd UDSim/src

  make
}

package() {
  cd UDSim

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 755 src/udsim "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  cp -a data "$pkgdir/usr/share/$pkgname/data"
}

